Client Mandatory Functions
Client mandatory functions are called by engine and therefore must be defined for server to start. __TOC__ General purpose 'start' Syntax: bool start ( ) Returns: If you return false, the game will not start. Description: 'Called when client starts or when the module client_main is reloaded. 'loop Syntax: uint loop ( ) Returns: Time in milliseconds, after which the function will be called again. If 0 is returned, this function won't be called again. Description: 'Called periodically with frequency specified by returned value. Rendering UI 'render_map Syntax: void render_map ( ) Description: 'Called by client to render map layer. DrawMap* functions can be used only here. This function is called before interface rendering. 'render_iface Syntax: void reder_iface ( ) Description: 'Called by client to render interface layer. Draw* functions can be used only here. 'get_elevator Syntax: bool get_elevator ( uint type, uint[]& data )''' '''Parameters: type - type of the elevator, see defined elevator types data - data required to create the elevator interface, see elevator data format Returns: True if the interface can be created, false otherwise. Description: Called when client needs to build the interface for an elevator. Message handling 'out_message' Syntax: bool out_message ( string& message, int& sayType )''' '''Parameters: message - text of the message sayType - type of the message (see defined say types)' Returns: '''If you return false the message is not sent.' Description:' Callled when a message is sent by the client. 'in_message' '''Syntax:' bool in_message ( string& message, int& sayType, uint& critterId, uint& delay )''' '''Parameters: message - text of the message sayType - type of the message (see defined say types) critterId - id of the critter which sent the message delay - how long the message is displayed. By default delay = (client preference) + message length * 100 ms. Description: Callled when client receives a message generated by a critter. 'map_message' Syntax: bool map_message ( string& message, uint16& hexX, uint16& hexY, uint& color , uint& delay )''' '''Parameters: message - text of the message hexX, hexY - coordinates of the message color - color of the message delay - how long the message is displayed. By default delay = (client preference) + message length * 100 ms. Description: Callled when client receives a message generated by map. Description handling 'item_description' Syntax: string item_description ( ItemCl& item, int lookType )''' '''Parameters: item - item for which the decription is created lookType - type of item description (see defined item look types)' Returns: '''A string describing the item.' Description:' Callled when it's necessary to create a description for an item. 'critter_description' '''Syntax:' string critter_description ( CritterCl& cr, int lookType )''' '''Parameters: cr - item for which the decription is created lookType - type of item description (see defined critter look types)' Returns: '''A string describing the critter.' Description:' Callled when it's necessary to create a description for a critter. 'generic_description' '''Syntax:' string generic_description ( int descType, int& offsX , int& offsY )''' '''Parameters: descType - type of description (see defined generic description types) offsX, offsY - offsets of text, by default it's 0''' Returns: A string with description Description:''' Callled when it's necessary to create a generic description in game. Category:Client API